﻿using System;
using System.Collections.Generic;
using System.Text;
using Volo.Abp.Authorization.Permissions;

namespace Wuther.Infrastructure.Permissions
{
    public partial class InfrastructurePermissionDefinitionProvider
    {
        public void AddPermission(PermissionGroupDefinition moduleGroup)
        {
            var blog = moduleGroup.AddPermission(InfrastructurePermissions.Blog.Default, L("Blog:Default"));
            blog.AddChild(InfrastructurePermissions.Blog.Create, L("Create"));
            blog.AddChild(InfrastructurePermissions.Blog.Update, L("Edit"));
            blog.AddChild(InfrastructurePermissions.Blog.Delete, L("Delete"));

            var organization = moduleGroup.AddPermission(InfrastructurePermissions.Organization.Default, L("Organization:Default"));
            organization.AddChild(InfrastructurePermissions.Organization.Create, L("Create"));
            organization.AddChild(InfrastructurePermissions.Organization.Update, L("Edit"));
            organization.AddChild(InfrastructurePermissions.Organization.Delete, L("Delete")); 

            var organizationUsers = moduleGroup.AddPermission(InfrastructurePermissions.OrganizationUsers.Default, L("OrganizationUsers:Default"));
            organizationUsers.AddChild(InfrastructurePermissions.OrganizationUsers.Create, L("Create"));
            organizationUsers.AddChild(InfrastructurePermissions.OrganizationUsers.Update, L("Edit"));
            organizationUsers.AddChild(InfrastructurePermissions.OrganizationUsers.Delete, L("Delete"));

            var scope = moduleGroup.AddPermission(InfrastructurePermissions.Scope.Default, L("Scope:Default"));
            scope.AddChild(InfrastructurePermissions.Scope.Create, L("Create"));
            scope.AddChild(InfrastructurePermissions.Scope.Update, L("Edit"));
            scope.AddChild(InfrastructurePermissions.Scope.Delete, L("Delete"));

            var PermissionGrants = moduleGroup.AddPermission(InfrastructurePermissions.PermissionGrant.Default, L("PermissionGrant:Default"));
            PermissionGrants.AddChild(InfrastructurePermissions.PermissionGrant.Create, L("Create"));
            PermissionGrants.AddChild(InfrastructurePermissions.PermissionGrant.Update, L("Edit"));
            PermissionGrants.AddChild(InfrastructurePermissions.PermissionGrant.Delete, L("Delete"));


        }
    }
}
